/// @tags: NetworkFlow MiniumChainCover
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>

using namespace std;

namespace BlueQuantum {

typedef long long LL;

int constexpr N = 7e3 + 3, INF = 0x3f3f3f3f;

int S, T, ecnt = 1, ncnt, tot, a[N], p[N];
int heads[N * 2], cur[N * 2], dep[N * 2];
LL n;
LL divi[N];

struct Edge {
  int v, nxt, f;
  Edge(int v = 0, int nxt = 0, int f = 0) : v(v), nxt(nxt), f(f) {}
} e[N * 800];

inline LL qpow(LL base, LL exp) {
  LL res = 1;
  while (exp) {
    if (exp & 1) res = res * base;
    base = base * base;
    exp >>= 1;
  }
  return res;
}

inline void get_div(int d, LL cur) {
  if (d > tot) return divi[++ncnt] = cur, void();
  for (int i = 0; i <= a[d]; i++) get_div(d + 1, cur * qpow(p[d], i));
}

inline void add(int u, int v, int f) {
  e[++ecnt] = Edge(v, heads[u], f), heads[u] = ecnt;
  e[++ecnt] = Edge(u, heads[v], 0), heads[v] = ecnt;
}

inline bool bfs() {
  memcpy(cur, heads, sizeof(cur));
  memset(dep, -1, sizeof(dep));
  queue<int> q;
  dep[S] = 0;
  q.push(S);
  while (q.empty() == false) {
    int u = q.front();
    q.pop();
    for (int i = heads[u], v; i; i = e[i].nxt) {
      if (dep[v = e[i].v] == -1 && e[i].f) {
        dep[v] = dep[u] + 1;
        q.push(v);
      }
    }
  }
  return dep[T] != -1;
}

int dinic(int u, int flow) {
  if (u == T) return flow;
  int rest = flow;
  for (int &i = cur[u], v; i; i = e[i].nxt) {
    if (dep[v = e[i].v] == dep[u] + 1 && e[i].f) {
      int k = dinic(v, min(rest, e[i].f));
      e[i].f -= k, e[i ^ 1].f += k;
      rest -= k;
      if (rest == 0) break;
    }
  }
  if (rest == 0) dep[u] = 0;
  return flow - rest;
  return 0;
}

inline int getMaxFlow() {
  int res = 0;
  while (bfs()) res += dinic(S, INF);
  return res;
}

inline int main() {
  cin >> n;
  for (int i = 2; 1ll * i * i <= n; i++)
    if (n % i == 0) {
      p[++tot] = i;
      while (n % i == 0) n /= i, a[tot]++;
    }
  if (n > 1) p[++tot] = n, a[tot] = 1;
  get_div(1, 1);
  S = 0, T = ncnt * 2 + 1;
  for (int i = 1; i <= ncnt; ++i)
    for (int j = 1; j <= ncnt; ++j)
      if (divi[i] < divi[j] && divi[j] % divi[i] == 0) add(i + ncnt, j, 1);
  for (int i = 1; i <= ncnt; ++i) add(S, i + ncnt, 1), add(i, T, 1);
  cout << ncnt - getMaxFlow();
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("divisor.in", "r", stdin);
  freopen("divisor.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
